<% layout('/layouts/default.html', {title: '财务管理管理', libs: ['validate']}){ %>
<div class="main-content">
	<div class="box box-main">
		<div class="box-header with-border">
			<div class="box-title">
				<i class="fa fa-list-alt"></i> ${smFinancialManagement.isNewRecord ? '新增财务管理' : '编辑财务管理'}
			</div>
			<div class="box-tools pull-right">
				<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
			</div>
		</div>
		<#form:form id="inputForm" model="${smFinancialManagement}" action="${ctx}/fm/smFinancialManagement/save" method="post" class="form-horizontal">
			<div class="box-body">
				<div class="form-unit">财务信息</div>
				<#form:hidden path="id"/>
				<div class="row">
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required ">*</span> 流水号：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:input path="serialNum" maxlength="50" readOnly="true" class="form-control required"/>
							</div>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required ">*</span> 所属驾校：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:treeselect id="officeId" title="驾校"
										path="officeId" labelPath="office.officeName"
										url="${ctx}/sys/office/treeData"
										class=" required" allowClear="true"/>
							</div>
						</div>
					</div>
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required ">*</span> 经办人：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:treeselect id="employeeId" title="经办人"
										path="employeeId" labelPath="empUser.userName"
										url="${ctx}/sys/office/treeData?isLoadUser=true"
										class=" required" allowClear="true"/>
							</div>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required ">*</span> 收支类型：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:select path="payType" dictType="DSMS_SZLX" blankOption="true" class="form-control required" />
							</div>
						</div>
					</div>
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required ">*</span> 费用类型：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:select path="costType" dictType="DSMS_FYLX" blankOption="true" class="form-control required" />
							</div>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required ">*</span> 发生日期：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:input path="paymentTime" readonly="true" maxlength="20" class="form-control Wdate required date"
									dataFormat="datetime" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm',isShowClear:false});"/>
							</div>
						</div>
					</div>
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required ">*</span> 发生金额：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:input path="transactionAmount" class="form-control required number"/>
							</div>
						</div>
					</div>
				</div>

				<div class="row">
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required hide">*</span> 费用说明：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:textarea path="costRemark" rows="4" maxlength="255" class="form-control"/>
							</div>
						</div>
					</div>
				</div>
			</div>
			<div class="box-footer">
				<div class="row">
					<div class="col-sm-offset-2 col-sm-10">
						<% if (hasPermi('fm:smFinancialManagement:edit')){ %>
							<button type="submit" class="btn btn-sm btn-primary" id="btnSubmit"><i class="fa fa-check"></i> 保 存</button>&nbsp;
						<% } %>
						<button type="button" class="btn btn-sm btn-default" id="btnCancel" onclick="js.closeCurrentTabPage()"><i class="fa fa-reply-all"></i> 关 闭</button>
					</div>
				</div>
			</div>
		</#form:form>
	</div>
</div>
<% } %>
<script>
$("#inputForm").validate({
	submitHandler: function(form){
		js.ajaxSubmitForm($(form), function(data){
			js.showMessage(data.message);
			if(data.result == Global.TRUE){
				js.closeCurrentTabPage(function(contentWindow){
					contentWindow.page();
				});
			}
		}, "json");
    }
});
</script>